package com.tarena.lab;
import java.sql.*;
public class Lab1 {
	public static void main(String[] args) {
											//oracle 数据库的驱动名
		String driverName = "oracle.jdbc.OracleDriver";
														//协议:地 址:端口: 数据库名
		String url = "jdbc:oracle:thin:@172.17.1.6:1521:tarena";
		String userName = "hfsd0909";//		用户名
		String pwd = "tarena";//用户密码		
		Connection con = null;
		try {
			Class.forName(driverName);
			con = DriverManager.getConnection(url, userName, pwd);
			System.out.println(con.getClass());
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			// 数据库连接的数量是有数的，所以用完以后要关掉
			try {
				con.close();
			} catch (Exception ex) {
				ex.printStackTrace();
			}
		}
	}
}